package com.region.integral.common_user.k.consume.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.region.integral.common_user.consume.dao.IKCurrencyBuyGoods;
import com.region.integral.common_user.k.consume.IConsumeKCurrency;
import com.region.integral.common_user.obtain.vo.IntegralData;
import com.region.integral.exception.IntegralException;
@Component("common_user_consumeK")
public class ConsumeKCurrencyImpl implements IConsumeKCurrency {
	@Resource(name="iBuyGoods")
	private IKCurrencyBuyGoods iBuyGoods;
	@Override
	public boolean byBuyGoods(int commonUserid, int kNum) {
		IntegralData integralData = new IntegralData();
		try {
			iBuyGoods.buyGoods(commonUserid, kNum, integralData);
		} catch (IntegralException e) {
			e.printStackTrace();
		}
		return integralData.isSuccee();
	}

}
